<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>创建学校</title>
    <link rel="stylesheet" type="text/css" href="../plugin/layui/css/layui.css" />
    <script src="../plugin/layui/layui.js" type="text/javascript" charset="utf-8"></script>
</head>
<body>
    <div id="app">
        <div>
            <button type="button" class="layui-btn layui-btn-normal layui-btn-lg" id="create">创建</button>
        </div>
        <div>
            <table id="schoolinfo" lay-filter="schoolinfo"></table>
        </div>
    </div>
    <script>
        layui.use(['table','jquery','layer'], function(){
            var table = layui.table,$=layui.jquery,layer=layui.layer;
            $("#create").click(function () {
                layer.open({
                    type:2,
                    area:['700px','450px'],
                    title:'学校基本信息',
                    content:'create.html',
                });
            })

            //第一个实例
            table.render({
                elem: '#schoolinfo'
                ,height: 312
                ,url: '../school/all' //数据接口
                ,page: true //开启分页
                ,limit:3
                ,limits:[3,6,9,12]
                ,cols: [[ //表头
                    {field: 'snumber', title: '学校编号', width:200, sort: true, fixed: 'left'}
                    ,{field: 'sname', title: '学校名', width:300}
                    ,{field: 'address', title: '学校地址', width:400}
                ]]
            });
        });
    </script>
</body>
</html>